<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <!--引入BootStrap的样式-->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/commons.css">
</head>
<body>

<div class="login">
    <h2 class="yhdl">
        用户登录
    </h2>
    <form class="form-horizontal" action="{% url 'user:login' %}" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="username" class="col-sm-2 control-label">用户名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名"
                       required="required"/>
            </div>
        </div>
        <div class="form-group">
            <label for="password" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码"
                       required="required"/>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                {% if error_message %}
                    <div class="alert alert-danger" role="alert">{{ error_message }}</div>
                {% endif %}
                <button type="submit" class="btn btn-primary">登录</button>
            </div>
        </div>

    </form>
    <p class="mb-1">
        <a href="#">忘记密码?</a>
    </p>
</div>

</body>
</html>